package com.yc.forum.servlet;

import com.yc.forum.dao.PostDao;
import com.yc.forum.util.Utils;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
import java.util.Map;

//index 热门帖子
@WebServlet(name = "HotPostServlet", value = "/HotPost.s")
public class HotPostServlet extends HttpServlet {
    private PostDao postdao=new PostDao();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        List<Map<String,Object>> list=postdao.selectHotPost();
        Utils.toJson(list,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
